package com.dime.basic.service.impl;

import java.util.List;

import com.dime.basic.api.domain.DimeBasesymptom;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.uuid.IdUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dime.basic.mapper.DimeBasesymptomMapper;

import com.dime.basic.service.IDimeBasesymptomService;

/**
 * 问诊症状Service业务层处理
 *
 * @author ruoyi
 * @date 2023-09-28
 */
@Service
public class DimeBasesymptomServiceImpl implements IDimeBasesymptomService
{
    @Autowired
    private DimeBasesymptomMapper dimeBasesymptomMapper;

    /**
     * 查询问诊症状
     *
     * @param id 问诊症状主键
     * @return 问诊症状
     */
    @Override
    public DimeBasesymptom selectDimeBasesymptomById(String id)
    {
        return dimeBasesymptomMapper.selectDimeBasesymptomById(id);
    }

    /**
     * 查询问诊症状列表
     *
     * @param dimeBasesymptom 问诊症状
     * @return 问诊症状
     */
    @Override
    public List<DimeBasesymptom> selectDimeBasesymptomList(DimeBasesymptom dimeBasesymptom)
    {
        return dimeBasesymptomMapper.selectDimeBasesymptomList(dimeBasesymptom);
    }

    /**
     * 新增问诊症状
     *
     * @param dimeBasesymptom 问诊症状
     * @return 结果
     */
    @Override
    public int insertDimeBasesymptom(DimeBasesymptom dimeBasesymptom)
    {
        dimeBasesymptom.setId(IdUtils.fastUUID());
        dimeBasesymptom.setCreateTime(DateUtils.getNowDate());
        dimeBasesymptom.setCreateBy(SecurityUtils.getUsername());
        return dimeBasesymptomMapper.insertDimeBasesymptom(dimeBasesymptom);
    }

    /**
     * 修改问诊症状
     *
     * @param dimeBasesymptom 问诊症状
     * @return 结果
     */
    @Override
    public int updateDimeBasesymptom(DimeBasesymptom dimeBasesymptom)
    {
        dimeBasesymptom.setUpdateBy(SecurityUtils.getUsername());
        dimeBasesymptom.setUpdateTime(DateUtils.getNowDate());
        return dimeBasesymptomMapper.updateDimeBasesymptom(dimeBasesymptom);
    }

    /**
     * 批量删除问诊症状
     *
     * @param ids 需要删除的问诊症状主键
     * @return 结果
     */
    @Override
    public int deleteDimeBasesymptomByIds(String[] ids)
    {
        return dimeBasesymptomMapper.deleteDimeBasesymptomByIds(ids);
    }

    /**
     * 删除问诊症状信息
     *
     * @param id 问诊症状主键
     * @return 结果
     */
    @Override
    public int deleteDimeBasesymptomById(String id)
    {
        return dimeBasesymptomMapper.deleteDimeBasesymptomById(id);
    }
}
